package com.my.cd.chain;

/**
 * 链结构具体处理者：部门经理处理者
 */
public class DepartmentApprover extends Approver {

    public DepartmentApprover(String name) {
        super(name + " DepartmentLeader");
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        if (5000 <= request.getSum() && request.getSum() < 10000) {
            System.out.println("**This request " + request.getId() + " ,money = " + request.getSum() + " will be handled by " + this.name + " **");
        } else {
            nextApprover.processRequest(request);
        }
    }
}
